<?php

class BUIWXPage extends BUIWXControl {

    //put your code here
    public function onRender($data = NULL) {
        parent::onRender($data);
        $weChatApp = Blyn::app()->getActiveSpace()->getAppByName('BWeChat');
        if ($weChatApp instanceof BWeChat) {
            $wxActiveMenu = $weChatApp->getActiveMenuItem();
            //below code is a dummy setting, in actually, we should get menu item from wechat 
            $wxActiveMenu = 'jiudian';

            if ($wxActiveMenu == 'chongshang_home') {
                $this->addRenderView('chongshang_home', 'chongshang_home');
            }
            
            if($wxActiveMenu == 'baihuo'){
                $this->addRenderView('baihuo', 'baihuo');
            }
            
            if($wxActiveMenu == 'jiudian'){
                $this->addRenderView('jiudian', 'jiudian');
            }
            
            if($wxActiveMenu == 'qiche'){
                $this->addRenderView('qiche', 'qiche');
            }
        }
    }

}

?>
